package com.armedia.remote.server;

import com.anotherrobbo.armedia.server.MediaServer;
import com.armedia.remote.client.MediaService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class MediaServiceImpl extends RemoteServiceServlet implements MediaService {

	private MediaServer mediaServer;

	public MediaServiceImpl() {
		this.mediaServer = MediaServer.getInstance("/armedia.properties");
	}
	
	@Override
	public void play() throws IllegalArgumentException {
		mediaServer.getPlayerEngine().play();
	}
	
	@Override
	public void next() throws IllegalArgumentException {
		mediaServer.getPlayerEngine().next();
	}
	
	@Override
	public void prev() throws IllegalArgumentException {
		mediaServer.getPlayerEngine().prev();
	}
	
}
